{% load static %}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {% block my_head %}{% endblock %}
    <link rel="stylesheet"
          href="{% static 'bootstrap-3.3.4-dist/css/bootstrap.css' %}">
    <link href="{% static 'my/nav.css' %}" rel="stylesheet" type="text/css">
</head>
<body>

<nav>
    <!-- 导航栏左侧内容 -->
    <div class="btn-group btn-group-lg con" role="group" aria-label="导航栏">
        <ul class="nav nav-pills">
            <li>
                <span style="font-size: xx-large">- - - - logo - - - - -</span>
            </li>
            {# 主页 #}
            <li role="presentation" {% if request.path == '/' %} class="active" {% endif %}>
                <a href="/">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                         class="bi bi-house" viewBox="0 0 16 16">
                        <path fill-rule="evenodd"
                              d="M8.707 1.5a1 1 0 0 0-1.414 0L.646 8.146a.5.5 0 0 0 .708.708L2 8.207V13.5A1.5 1.5 0 0 0 3.5 15h9a1.5 1.5 0 0 0 1.5-1.5V8.207l.646.647a.5.5 0 0 0 .708-.708L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.707 1.5ZM13 7.207l-5-5-5 5V13.5a.5.5 0 0 0 .5.5h9a.5.5 0 0 0 .5-.5V7.207Z"/>
                    </svg>
                    主页
                </a></li>
            <li role="presentation" {% if request.path == '/post/' %} class="active" {% endif %}>
                <a href="/post/">
                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                         class="bi bi-card-list" viewBox="0 0 16 16">
                        <path d="M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h13zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-13z"/>
                        <path d="M5 8a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7A.5.5 0 0 1 5 8zm0-2.5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm0 5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 0 1h-7a.5.5 0 0 1-.5-.5zm-1-5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0zM4 8a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0zm0 2.5a.5.5 0 1 1-1 0 .5.5 0 0 1 1 0z"/>
                    </svg>
                    全部帖子
                </a></li>
            {% if request.session.info %}
                <li role="presentation" {% if request.path == '/post/new/' %} class="active" {% endif %}>
                    <a href="/post/new/">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                             class="bi bi-chat-dots" viewBox="0 0 16 16">
                            <path d="M5 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/>
                            <path d="m2.165 15.803.02-.004c1.83-.363 2.948-.842 3.468-1.105A9.06 9.06 0 0 0 8 15c4.418 0 8-3.134 8-7s-3.582-7-8-7-8 3.134-8 7c0 1.76.743 3.37 1.97 4.6a10.437 10.437 0 0 1-.524 2.318l-.003.011a10.722 10.722 0 0 1-.244.637c-.079.186.074.394.273.362a21.673 21.673 0 0 0 .693-.125zm.8-3.108a1 1 0 0 0-.287-.801C1.618 10.83 1 9.468 1 8c0-3.192 3.004-6 7-6s7 2.808 7 6c0 3.193-3.004 6-7 6a8.06 8.06 0 0 1-2.088-.272 1 1 0 0 0-.711.074c-.387.196-1.24.57-2.634.893a10.97 10.97 0 0 0 .398-2z"/>
                        </svg>
                        发布新帖子
                    </a></li>
            {% endif %}
        </ul>
    </div>
    <!-- 导航栏右侧内容 -->
    <div class=" navbar-right btn-group btn-group-lg con">
        <ul class="nav nav-pills">
            {# 判断是登录还是注销 #}
            {% if request.session.info %}
                <li role="presentation">
                    <a href="/user_logout/">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                             class="bi bi-person-fill-x" viewBox="0 0 16 16">
                            <path d="M11 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm-9 8c0 1 1 1 1 1h5.256A4.493 4.493 0 0 1 8 12.5a4.49 4.49 0 0 1 1.544-3.393C9.077 9.038 8.564 9 8 9c-5 0-6 3-6 4Z"></path>
                            <path fill-rule="evenodd"
                                  d="M12.5 16a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm-.646-4.854a.5.5 0 0 0-.708.708l.647.646-.647.646a.5.5 0 0 0 .708.708l.646-.647.646.647a.5.5 0 0 0 .708-.708l-.647-.646.647-.646a.5.5 0 0 0-.708-.708l-.646.647-.646-.647Z"></path>
                        </svg>
                        logout
                    </a></li>
                {% with str=request.session.info.id|stringformat:"s" %}
                    {% with edit_url="/"|add:str|add:"/edit/" %}
                        <li role="presentation"
                                {% if edit_url == request.path %} class="active" {% endif %}>
                    {% endwith %}
                {% endwith %}
            <a href="/{{ request.session.info.id }}/edit/">
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                     class="bi bi-person-fill-gear" viewBox="0 0 16 16">
                    <path d="M11 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm-9 8c0 1 1 1 1 1h5.256A4.493 4.493 0 0 1 8 12.5a4.49 4.49 0 0 1 1.544-3.393C9.077 9.038 8.564 9 8 9c-5 0-6 3-6 4Z"></path>
                    <path fill-rule="evenodd"
                          d="M11.886 9.46c.18-.613 1.048-.613 1.229 0l.043.148a.64.64 0 0 0 .921.382l.136-.074c.561-.306 1.175.308.87.869l-.075.136a.64.64 0 0 0 .382.92l.149.045c.612.18.612 1.048 0 1.229l-.15.043a.64.64 0 0 0-.38.921l.074.136c.305.561-.309 1.175-.87.87l-.136-.075a.64.64 0 0 0-.92.382l-.045.149c-.18.612-1.048.612-1.229 0l-.043-.15a.64.64 0 0 0-.921-.38l-.136.074c-.561.305-1.175-.309-.87-.87l.075-.136a.64.64 0 0 0-.382-.92l-.148-.045c-.613-.18-.613-1.048 0-1.229l.148-.043a.64.64 0 0 0 .382-.921l-.074-.136c-.306-.561.308-1.175.869-.87l.136.075a.64.64 0 0 0 .92-.382l.045-.148ZM14 12.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"></path>
                </svg>
                编辑
            </a></li>
            {% else %}
                <li role="presentation"
                        {% if request.path == '/user_login/' %} class="active" {% endif %}>
                    <a href="{% url 'user_login' %}">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                             class="bi bi-person-fill-up" viewBox="0 0 16 16">
                            <path fill-rule="evenodd"
                                  d="M12.5 16a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm.354-5.854a.5.5 0 0 0-.708 0l-1.5 1.5a.5.5 0 0 0 .708.708l.646-.647V14.5a.5.5 0 0 0 1 0v-2.793l.646.647a.5.5 0 0 0 .708-.708l-1.5-1.5Z"></path>
                            <path d="M11 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm-9 8c0 1 1 1 1 1h5.256A4.493 4.493 0 0 1 8 12.5a4.49 4.49 0 0 1 1.544-3.393C9.077 9.038 8.564 9 8 9c-5 0-6 3-6 4Z"></path>
                        </svg>
                        login
                    </a></li>
            {% endif %}
            {# 注册 #}
            <li role="presentation"
                    {% if not request.session.info %}
                        {% if request.path == '/register/' %} class="active" {% endif %}>
                            <a href="/register/">
                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                     class="bi bi-person-fill-add" viewBox="0 0 16 16">
                                    <path fill-rule="evenodd"
                                          d="M12.5 16a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm.5-5a.5.5 0 0 0-1 0v1h-1a.5.5 0 0 0 0 1h1v1a.5.5 0 0 0 1 0v-1h1a.5.5 0 0 0 0-1h-1v-1Z"></path>
                                    <path d="M11 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm-9 8c0 1 1 1 1 1h5.256A4.493 4.493 0 0 1 8 12.5a4.49 4.49 0 0 1 1.544-3.393C9.077 9.038 8.564 9 8 9c-5 0-6 3-6 4Z"></path>
                                </svg>
                                register</a></li>
                    {% endif %}
            {# 用户信息 #}
            {% if request.session.info %}
                {% with str=request.session.info.id|stringformat:"s" %}
                    {% with edit_url="/"|add:str|add:"/" %}
                        <li role="presentation"
                                {% if edit_url == request.path %} class="active" {% endif %}>
                    {% endwith %}
                {% endwith %}
            <a href="/{{ request.session.info.id }}/">
                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                     class="bi bi-person-fill-check" viewBox="0 0 16 16">
                    <path fill-rule="evenodd"
                          d="M12.5 16a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm1.679-4.493a.5.5 0 1 0-.858-.514l-1.17 1.95-.547-.547a.5.5 0 0 0-.708.708l.774.773a.75.75 0 0 0 1.174-.144l1.335-2.226Z"></path>
                    <path d="M11 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm-9 8c0 1 1 1 1 1h5.256A4.493 4.493 0 0 1 8 12.5a4.49 4.49 0 0 1 1.544-3.393C9.077 9.038 8.564 9 8 9c-5 0-6 3-6 4Z"></path>
                </svg>
                {{ request.session.info.username }}
            </a></li>
            {% else %}
                <li role="presentation">
                    <a href="/admin/login">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                             class="bi bi-person-up" viewBox="0 0 16 16">
                            <path fill-rule="evenodd"
                                  d="M12.5 16a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Zm.354-5.854a.5.5 0 0 0-.708 0l-1.5 1.5a.5.5 0 0 0 .708.708l.646-.647V14.5a.5.5 0 0 0 1 0v-2.793l.646.647a.5.5 0 0 0 .708-.708l-1.5-1.5ZM11 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM8 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"></path>
                            <path d="M8.256 14a4.474 4.474 0 0 1-.229-1.004H3c.001-.246.154-.986.832-1.664C4.484 10.68 5.711 10 8 10c.26 0 .507.009.74.025.226-.341.496-.65.804-.918C9.077 9.038 8.564 9 8 9c-5 0-6 3-6 4s1 1 1 1h5.256Z"></path>
                        </svg>
                        管理员登录
                    </a></li>
                <li role="presentation">
                    <a href="">
                        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                             class="bi bi-person-exclamation" viewBox="0 0 16 16">
                            <path fill-rule="evenodd"
                                  d="M11 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0ZM8 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z"></path>
                            <path d="M8.256 14a4.474 4.474 0 0 1-.229-1.004H3c.001-.246.154-.986.832-1.664C4.484 10.68 5.711 10 8 10c.26 0 .507.009.74.025.226-.341.496-.65.804-.918C9.077 9.038 8.564 9 8 9c-5 0-6 3-6 4s1 1 1 1h5.256Z"></path>
                            <path fill-rule="evenodd"
                                  d="M16 12.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Zm-3.5-2a.5.5 0 0 1 .5.5v1.5a.5.5 0 0 1-1 0V11a.5.5 0 0 1 .5-.5Zm0 4a.5.5 0 1 0 0-1 .5.5 0 0 0 0 1Z"></path>
                        </svg>
                        未登录
                    </a></li>
            {% endif %}
            </li>
            <li role="presentation">
                <a></a>
            </li>
        </ul>
    </div>
</nav>
<br>
<br>
<div class="container">
    {% block context %}{% endblock %}
</div>
<!-- 下面是分页 -->
{#<nav aria-label="Page navigation">#}
{#    <ul class="pagination">#}
{#        <li>#}
{#            <a href="#" aria-label="Previous">#}
{#                <span aria-hidden="true">&laquo;</span>#}
{#            </a>#}
{#        </li>#}
{#        <li><a href="#">1</a></li>#}
{#        <li><a href="#">2</a></li>#}
{#        <li><a href="#">3</a></li>#}
{#        <li><a href="#">4</a></li>#}
{#        <li><a href="#">5</a></li>#}
{#        <li>#}
{#            <a href="#" aria-label="Next">#}
{#                <span aria-hidden="true">&raquo;</span>#}
{#            </a>#}
{#        </li>#}
{#    </ul>#}
{#</nav>#}
{% block footer %}
    <hr> <!-- 区分线 -->
    <footer class="site-footer">
        <div class="footer-content">
            <p>版权所有 &copy; 2023 xlx. 保留所有权利。</p>
            <!-- 添加更多的信息或链接 -->
            <ul class="footer-links">
                <li><a href="#">关于我们</a></li>
                <li><a href="#">隐私政策</a></li>
                <li><a href="#">使用条款</a></li>
            </ul>
        </div>
    </footer>
{% endblock %}
{% block my_link %}{% endblock %}
<!-- 分页结束 -->
<script src="{% static 'js/jquery-1.11.2.min.js' %}"></script>
<script src="{% static 'bootstrap-3.3.4-dist/js/bootstrap.js' %}"></script>
</body>
</html>